import request from '@/utils/request'

// 查询工程信息列表
export function listEngineering(query) {
  return request({
    url: '/business/engineering/list',
    method: 'get',
    params: query
  })
}

// 查询工程信息详细
export function getEngineering(engineeringId) {
  return request({
    url: '/business/engineering/' + engineeringId,
    method: 'get'
  })
}

// 新增工程信息
export function addEngineering(data) {
  return request({
    url: '/business/engineering',
    method: 'post',
    data: data
  })
}

// 修改工程信息
export function updateEngineering(engineeringId, data) {
  return request({
    url: '/business/engineering/' + engineeringId,
    method: 'put',
    data: data
  })
}

// 删除工程信息
export function delEngineering(engineeringId) {
  return request({
    url: '/business/engineering/' + engineeringId,
    method: 'delete'
  })
}

// 获取对应阶段的碳排放
export function getPhase(data) {
  return request({
    url: '/business/equipmentConfig/phase',
    method: 'get',
    params: data
  })
}

// 保存对应阶段的碳排放
export function savePhase(data) {
  return request({
    url: '/business/equipmentConfig/phase',
    headers: {
      repeatSubmit: true,
      interval: 2000
    },
    method: 'post',
    data: data
  })
}

// 保存对应阶段的碳排放
export function listAll(query) {
  return request({
    url: '/business/equipmentConfig/phase/all',
    method: 'get',
    params: query
  })
}
